<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑英雄</title>
</head>
<body>
<script type="text/html" id="form">
    <input type="hidden" name="id" value="{{ d.id }}"/>
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">所属英雄</label>
                        <div class="layui-input-block" style="width: 200px">
                            <div class="xmSelect"
                                 data-name="hero_id"
                                 data-sourceType="route"
                                 data-source="/admin.wz.Hero/list"
                                 data-radio="true"
                                 data-textField="name"
                                 data-valueField="id"
                                 data-selected="{{=d.hero_id}}"
                            ></div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <blockquote class="layui-elem-quote">推荐出装</blockquote>
                    <label class="layui-form-label">
                        <text title="必填项" style="color:red;">*</text>
                        推荐方案</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="sort"
                             data-sourceType="data"
                             data-radio="true"
                             data-source="[{name:'1',value:'1'},{name:'2',value:'2'},{name:'3',value:'3'},{name:'4',value:'4'}]"
                             data-selected="{{=d.sort}}"
                             data-layVerify="required"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">标语</label>
                        <div class="layui-input-block" style="width: 200px">
                            <div class="xmSelect"
                                 data-name="label_id"
                                 data-sourceType="route"
                                 data-source="/admin.wz.label/list"
                                 data-radio="true"
                                 data-textField="name"
                                 data-valueField="id"
                                 data-selected="{{=d.label_id}}"
                            ></div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">召唤师技能</label>
                        <div class="layui-input-block" style="width: 200px">
                            <div class="xmSelect"
                                 data-name="sum_skill_id"
                                 data-sourceType="route"
                                 data-source="/admin.wz.sumskill/list"
                                 data-radio="true"
                                 data-textField="name"
                                 data-valueField="id"
                                 data-selected="{{=d.sum_skill_id}}"
                            ></div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        技能加点</label>
                    <div class="layui-input-block">
                        <input type="text" name="skill_priority" value="{{d.skill_priority}}" autocomplete="off"
                               placeholder="请输入技能加点" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">核心装备</label>
                        <div class="layui-input-block" style="width: 190px">
                            <div class="xmSelect"
                                 data-name="master_recommend_id"
                                 data-sourceType="route"
                                 data-source="/admin.wz.programme/list"
                                 data-radio="true"
                                 data-textField="name"
                                 data-valueField="id"
                                 data-selected="{{=d.master_recommend_id}}"
                            ></div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label two-part-label">推荐装备</label>
                    <div class="layui-inline"  style="width: 190px">
                        <div class="xmSelect"
                             data-name="recommend_equipment1"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment1}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="recommend_equipment3"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment3}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="recommend_equipment5"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment5}}"
                        ></div>
                    </div>
                    <div class="layui-inline" style="width: 190px">
                        <div class="xmSelect"
                             data-name="recommend_equipment2"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment2}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="recommend_equipment4"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment4}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="recommend_equipment6"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.recommend_equipment6}}"
                        ></div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text title="必填项" style="color:red;">*</text>
                        出装顺序</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="equipment_sort1"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort1}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort5"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort5}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort9"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort9}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="equipment_sort2"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort2}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort6"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort6}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort10"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort10}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="equipment_sort3"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort3}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort7"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort7}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort11"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort11}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="equipment_sort4"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort4}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort8"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort8}}"
                        ></div>
                        <div class="xmSelect"
                             data-name="equipment_sort12"
                             data-sourceType="route"
                             data-source="/admin.wz.programme/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.equipment_sort12}}"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text title="必填项" style="color:red;">*</text>
                        铭文</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="inscriptions1"
                             data-sourceType="route"
                             data-source="/admin.wz.inscription/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.inscriptions1}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label">
                            数量</label>
                        <div class="layui-input-block" style="width: 100px">
                            <input type="text" name="inscriptions1_num" value="{{d.inscriptions1_num}}"
                                   autocomplete="off"
                                   placeholder="个数" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="inscriptions2"
                             data-sourceType="route"
                             data-source="/admin.wz.inscription/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.inscriptions2}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block" style="width: 100px">
                            <input type="text" name="inscriptions2_num" value="{{d.inscriptions2_num}}"
                                   autocomplete="off"
                                   placeholder="个数" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="inscriptions3"
                             data-sourceType="route"
                             data-source="/admin.wz.inscription/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.inscriptions3}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block" style="width: 100px">
                            <input type="text" name="inscriptions3_num" value="{{d.inscriptions3_num}}"
                                   autocomplete="off"
                                   placeholder="个数" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="inscriptions4"
                             data-sourceType="route"
                             data-source="/admin.wz.inscription/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.inscriptions4}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block" style="width: 100px">
                            <input type="text" name="inscriptions4_num" value="{{d.inscriptions4_num}}"
                                   autocomplete="off"
                                   placeholder="个数" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="inscriptions5"
                             data-sourceType="route"
                             data-source="/admin.wz.inscription/list"
                             data-radio="true"
                             data-textField="name"
                             data-valueField="id"
                             data-selected="{{=d.inscriptions5}}"
                        ></div>
                    </div>
                    <div class="layui-input-inline">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block" style="width: 100px">
                            <input type="text" name="inscriptions5_num" value="{{d.inscriptions5_num}}"
                                   autocomplete="off"
                                   placeholder="个数" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">出装说明</label>
                        <div class="layui-input-block" style="width: 400px">
                            <div class="layui-input-bloctruek">
                                <textarea name="description" placeholder="请输入出装说明"
                                          class="layui-textarea">{{=d.description}}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">铭文说明</label>
                        <div class="layui-input-block" style="width: 400px">
                            <div class="layui-input-bloctruek">
                                <textarea name="recommend_reason" placeholder="请输入铭文说明"
                                          class="layui-textarea">{{=d.recommend_reason}}</textarea>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit=""
                    lay-filter="laytp-form">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="laytp-btn laytp-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</script>
<form class="layui-form" lay-filter="layui-form"></form>
<script>
    if (localStorage.getItem("staticDomain")) {
        document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") + "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v=" + localStorage.getItem("version") + "'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v=" + localStorage.getItem("version") + "'><\/script>");
    } else {
        document.write("<link rel='stylesheet' href='/static/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='/static/component/layui/layui.js?v=" + localStorage.getItem("version") + "'><\/script>");
        document.write("<script src='/static/component/laytp/layuiConfig.js?v=" + localStorage.getItem("version") + "'><\/script>");
    }
</script>
<script>
    layui.use(['laytp'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        //获取参数ID
        var id = facade.getUrlParam('id');
        if (!id) {
            facade.error('参数ID不能为空');
            return false;
        }

        //获取数据，渲染到对应的节点上
        facade.ajax({
            route: "/admin.wz.programme/info",
            data: {id: id},
            successAlert: false,
            showLoading: true
        }).done(function (res) {
            if (res.code === 0) {
                layui.laytpl($("#form").html()).render(res.data, function (string) {
                    $("form").html(string);
                    layui.laytpForm.render();
                    form.render();
                });
            }
        });

        form.on('submit(laytp-form)', function (data) {
            var btnAnim = layui.button.load({elem: $(this)});
            facade.ajax({
                route: '/admin.wz.programme/edit',
                data: data.field
            }).done(function (res) {
                if (res.code === 0) {
                    parent.layui.layer.close(parent.layui.layer.getFrameIndex(window.name));//关闭当前页
                    parent.layui.table.reload("laytp-table");
                }
                btnAnim.stop();
            }).fail(function () {
                btnAnim.stop();
            });
            return false;
        });
    })
</script>
</body>
</html>